﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernate;
using FluentNHibernate.Data;

namespace BankCreditPortfolio.DAL.Entities
{
    public class Profile
    {
        public virtual int ProfileId { get; set; }
        public virtual string Adress { get; set; }
        public virtual string Phone { get; set; }
        public virtual string FirstName { get; set; }
        public virtual string LastName { get; set; }
        public virtual string MiddleName { get; set; }
        public virtual string PassportIssuingAuthority { get; set; }
        public virtual DateTime PassportDate { get; set; }
        public virtual string PersonalId { get; set; }
        public virtual string Work { get; set; }
    }

    public class ProfileMap : ClassMap<Profile>
    {
        public ProfileMap()
        {
            Id(x => x.ProfileId).GeneratedBy.HiLo("profile");
            Id(x => x.ProfileId).Unique();
            Map(x => x.Adress);
            Map(x => x.Phone);
            Map(x => x.FirstName);
            Map(x => x.LastName);
            Map(x => x.MiddleName);
            Map(x => x.PassportIssuingAuthority);
            Map(x => x.PassportDate);
            Map(x => x.PersonalId);
            Map(x => x.Work);
            Table("Profile");
        }
    }
}
